<template>
  <!-- 表格 -->
  <el-table :data="tableData" border style="width: 100%">
    <el-table-column type="selection" width="55"> </el-table-column>
    <el-table-column type="index" label="序号" width="60" align="center">
    </el-table-column>
    <el-table-column prop="name" label="角色名称" align="center">
    </el-table-column>
    <el-table-column prop="remark" label="备注" align="center"> </el-table-column>
    <el-table-column label="操作" align="center">
      <template slot-scope="scope">
        <el-button size="mini" type="primary" @click="rightDialog(scope.row.id)"
          >分配权限</el-button
        >
        <el-button size="mini" type="success" @click="editDialog(scope.row.id)"
          >编辑</el-button
        >
        <el-button size="mini" type="danger" @click="delItem(scope.row.id)"
          >删除</el-button
        >
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  props: {
    tableData: Array,
  },
  methods: {
    // 删除
    delItem(id) {
      this.$emit("delItem", id);
    },
    // 编辑 dialog
    editDialog(id) {
      this.$emit("editDialog", id);
    },
    // 分配权限 dialog
    rightDialog() {
      this.$emit("rightDialog");
    }
  },
};
</script>

<style scoped></style>
